import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Program1 {
    public static void main(String[] args) {
        Map<String,Integer> records = new HashMap<>();

        Scanner sc = new Scanner(System.in);
        String name = sc.next();

        while (!name.equals("x") && !name.equals("X")) {
            if(records.containsKey(name)){
                Integer value = records.get(name);
                value=value+1;
                records.put(name,value);

            }else{
                records.put(name,1);
            }
            name = sc.next();
        }
        sc.close();

        for (String eachKey:records.keySet()){
            System.out.printf("%s的缺勤次数是%d\r\n",eachKey,records.get(eachKey));
        }
        System.out.println();

        for (Map.Entry<String,Integer> eachPair:records.entrySet()){
            System.out.printf("%s的缺勤次数是%d\r\n",eachPair.getKey(),eachPair.getValue());
        }
    }
}
